using System;
using System.Collections.Generic;

namespace tutFuelCellGame
{
    public class Barriers
    {
        private List<Barrier> _list = new List<Barrier>();

        public void Clear()
        {
            _list.Clear();
        }

        public void Add(Barrier barrier)
        {
            _list.Add(barrier);
        }

        public void Reset()
        {
            _list.ForEach((v) => v.Reset());
        }

        public void ForEach(Action<Barrier> action)
        {
            _list.ForEach(action);
        }

        public Barrier Find(Predicate<Barrier> predicate)
        {
            return _list.Find(predicate);
        }
    }
}